﻿@model Project.Database.User
<fieldset>
    <legend>User</legend>
    <div class="display-label">
        First Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Profile.FirstName)
    </div>
    <div class="display-label">
        Last Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Profile.LastName)
    </div>
    <div class="display-label">
        UserName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.UserName)
    </div>
    <div class="display-label">
        Email</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Email)
    </div>
</fieldset>
<fieldset>
    <legend>Blogs</legend>
    <div class="display-label">
        Blogs</div>
    <ul>
        @foreach (Project.Database.Blog blog in ViewBag.Blogs)
        { 
            <li>Name: @blog.Name</li>
            <li>URL: @blog.URL</li>
            <li>Keywords: @blog.Keywords</li>
            <li>Category: @blog.BlogCategory.Name</li>
            foreach (Project.Database.Advert ad in @blog.Adverts)
            { 
                <li>Advert: @ad.Name</li>
                <li>Clicks: @ad.Clicks.Count</li>
            }
            @Html.ActionLink("Show details", "Show", "Blog", new { id = blog.ID }, null)
        }
    </ul>
    @Html.ActionLink("Add a blog", "AddBlog", "Blog")
</fieldset>
